import axios from '../utils/axios';
import axiosCode from '../utils/axiosCode';

export const Api = {
    // 获取首页分类数据
    gEtHomeNavUrl: () => {
        return axios.get('store/navi.json?gender=2');
    },
    //获取首页主要数据
    getHomePageUrl: () => {
        return axios.get('store/show.json?type=recommend$uuid=f2cb32ff209f4010911a77a617add8c4');
    },
    // 获取排行榜主要数据
    requestHomeRankingData: () => {
        return axios.get("store/show.json?type=female_free&uuid=19ef3f613db44231983a48a570fc0a9");
    },
    // 获取分类主要数据
    requestHomeClassificationData: () => {
        return axios.get("store/info.json?type=female&bar=cat&uuid=d6f496cf3b45479795fe087dbb5ea90a");
    },
    // 获取男生小说主要数据
    requesHomeBoyData: () => {
        return axios.get("store/show.json?type=male&uuid=ca03da7b64ca443ab25ec3b662fa91e2");
    },
    // 获取女生小说主要数据
    requesHomeGirlData: () => {
        return axios.get("store/show.json?type=femail&uuid=017de2274aa5400e9dabe30f173e98d9");
    },
    //获取验证码
    requesRegisterGetCode: (phoneNumber: String) => {
        return axiosCode.get(`sent?phone=${phoneNumber}`)
    },
    //检验验证码
    RegisterVerificationCode: (phoneNumber: String, captcha: Number | String) => {
        return axiosCode.get(`/verify?phone=${phoneNumber}&captcha=${captcha}`)
    },
    // 书籍最新章节数据
    DetailNewUrl: (id: String) => {
        return axios.get(`book/simpleInfo.json?id=${id}`)
    },
    //书籍信息
    DetailInformationUrl: (id: String) => {
        return axios.get(`book/info.json?sourceUuid=${id}`)
    },
    //书本详情
    DetailBookUrl: (id: String, title: String) => {
        return axios.get(`book/getsub.json?id=${id}&title=${title}`)
    },
    //书本目录
    DetailBookCatalogueUrl: (id: String) => {
        return axios.get(`book/catalog.json?tocId=${id}`)
    },
    //热门推荐
    DetailHotUrl: () => {
        return axios.get(`store/rankList.json?rankType=26&uuid=ca03da7b64ca443ab25ec3b662fa91e2&all=0`)
    },
    //目录页数据
    CatalogueUrl: (id: String) => {
        return axios.get(`reader/book/info.json?source_uuid=${id}`)
    },
    //小说数据
    LookBookUrl: (source_uuid: String, content_uuid: String) => {
        return axios.get(`reader/book/content.json?source_uuid=${source_uuid}&content_uuid=${content_uuid}`)
    },
    //热门搜索热词 
    SearchHotUrl: () => {
        return axios.get(`search/getHotWords`);
    },
    //搜索
    SearchUrl: (keyWords: String) => {
        return axios.get(`search/book/data.json?key=${keyWords}`);
    }
}